<?
define('ROOT', $_SERVER['DOCUMENT_ROOT']);
require_once(ROOT.'/public/db.php');
require_once(ROOT.'/public/json.php');
$key = $_REQUEST['id'];
$ql = "select * from tree_data where vParent='".$key."'";
//echo $ql;
$rs = mysql_query($ql);
$lt = array();
while($r = mysql_fetch_array($rs)){
	$a = array();
	$a['key'] = $r['vCode'];
	$a['title'] = $r['vName'];
	$a['code'] = $r['vCode'];//
	$a['name'] = $r['vName'];//
	$a['parent'] = $r['vParent'];
	$a['path'] = $r['vPath'];
	$a['childCount'] = $r['iChildCount']*1;
	$a['level'] = $r['tLevel']*1;
	$a['isFolder'] = $a['childCount']>0;
	$a['isLazy'] = $a['isFolder'];
	$lt[] = $a;
}
$dd = array('success'=>true, 'data'=>$lt);
echo $JSON->encode($dd);
?>